import request from '@/utils/request'
// 查询学校列表
export function schoolPage(query) {
  return request({
    url: '/person/school/page',
    method: 'get',
    params: query
  })
}
// 添加学校
export function schoolAdd(data) {
  return request({
    url: '/person/school',
    method: 'post',
    data: data
  })
}
// 修改学校
export function schoolAlter(data) {
  return request({
    url: '/person/school',
    method: 'put',
    data: data
  })
}
// 删除学校
export function schoolDel(userId) {
  return request({
    url: '/person/school/'+ userId,
    method: 'delete'
  })
}
// 添加师资
export function teacherAdd(data) {
  return request({
    url: '/person/teacher',
    method: 'post',
    data: data
  })
}
// 修改师资
export function teacherPut(data) {
  return request({
    url: '/person/teacher',
    method: 'put',
    data: data
  })
}
// 查询师资列表
export function teacherPage(query) {
  return request({
    url: '/person/teacher/page',
    method: 'get',
    params: query
  })
}
// 删除师资
export function teacherDel(userId) {
  return request({
    url: '/person/teacher/'+ userId,
    method: 'delete'
  })
}
// 查询学生列表
export function studentPage(query) {
  return request({
    url: '/person/student/page',
    method: 'get',
    params: query
  })
}

// 查询民族列表
export function studentNations(query) {
  return request({
    url: '/person/student/nations',
    method: 'get',
    params: query
  })
}

// 添加学生信息
export function personStudent(data) {
  return request({
    url: '/person/student',
    method: 'post',
    data: data
  })
}
// 修改学生信息
export function personStudentPut(data) {
  return request({
    url: '/person/student',
    method: 'put',
    data: data
  })
}

// 删除学生
export function delDent(userId) {
  return request({
    url: '/person/student/' + userId,
    method: 'delete'
  })
}

// 获取年级列表
export function gradeList(query) {
  return request({
    url: '/person/school/grade/page',
    method: 'get',
    params: query
  })
}
// 添加年级
export function gradeAdd(data) {
  return request({
    url: '/person/school/grade',
    method: 'post',
    data: data
  })
}

// 修改年级
export function gradePut(data) {
  return request({
    url: '/person/school/grade',
    method: 'put',
    data: data
  })
}

// 删除年级
export function gradeDel(Ids) {
  return request({
    url: '/person/school/grade/' + Ids,
    method: 'delete'
  })
}
// 获取年级详情
export function gradeDetails(id) {
  return request({
    url: '/person/school/grade/' + id,
    method: 'get',
  })
}

// 年级下拉选择
export function classPull(id) {
  return request({
    url: '/person/school/grade/list/' + id,
    method: 'get',
  })
}

// 学校组织树
export function schoolTree() {
  return request({
    url: '/person/school/tree',
    method: 'get',
  })
}
